package com.lmq.singleRespblty;

public class SingleRespbltyRevise {
    public static void main(String[] args) {
        RoadVehicle roadVehicle = new RoadVehicle();
        roadVehicle.run("摩托车");
        roadVehicle.run("汽车");

        AirVehicle airVehicle = new AirVehicle();
        airVehicle.run("飞机");
    }
}

// 这样做改动很大
//
class RoadVehicle{
    public void run(String vehicle){
        System.out.println(vehicle + "在公公路运行");
    }
}
class AirVehicle{
    public void run(String vehicle){
        System.out.println(vehicle + "在天空运行");
    }
}